﻿@model System.Collections.IList
@{
    ViewBag.Title = "QueryRequestHolidayDocument";
    Layout = "~/Views/Shared/_BaseLayout.cshtml";
    var X = Html.X();
}
<h2>
    QueryRequestHolidayDocument</h2>
@section headtag
{
    <script>
        var popWindow = function () {
            debugger;
            var loader = App.AddWindow.getLoader();
            loader.paramsFn.selectHolidayDocument = App.gpQueryHolidayDocuments.getRowsValues({ selectedOnly: true });
            loader.paramsFn.processState = '1';
            App.AddWindow.show(this);
        };
    </script>
}
@section example
{
    @(X.Viewport()
        .Layout(LayoutType.Border)
        .Items(
                X.Panel()
                  .Region(Region.Center)
                  .Margins("5 5 5 5")
                  .Items(
                        X.Button()
                            .ID("btnBaklogTaskList")
                            .Text("返回待办列表")
                            .DirectClickAction("QueryBaklogTask"),
                        X.Button()
                            .ID("btnPreview")
                            .Text("查看")
                            .Handler("App.AddWindow.show(this);"),
                        X.GridPanel()
                            .ID("gpQueryHolidayDocuments")
                            .Region(Region.Center)
                            .Title("请假申请列表")
                            .Store(X.Store()
                                    .Model(X.Model()
                                        .Fields(
                                                new ModelField("ID", ModelFieldType.String),
                                                new ModelField("RequestPerson", ModelFieldType.String),
                                                new ModelField("RequestDate", ModelFieldType.Date),
                                                new ModelField("Description", ModelFieldType.String)
                                                )
                                            )
                                    .DataSource(Model)
                                    )
                            .ColumnModel(
                                            X.Column().Text("Description").DataIndex("Description").Flex(1),
                                            X.DateColumn().Text("RequestDate").DataIndex("RequestDate").Format("yyyy-MM-dd")
                                         )
                         )
               )
    )
    @(X.Window()
        .ID("AddWindow")
        .Title("请假单申请")
        .Width(700)
        .Height(500)
        .Modal(true)
        .Collapsible(true)
        .Maximizable(true)
        .Hidden(true)
        .Loader(X.ComponentLoader()
                .Url("~/HolidayDocument/QueryHolidayDocument")
                .Mode(LoadMode.Frame)
                .ReloadOnEvent(true)
                .LoadMask(lm => lm.ShowMask = true)
                .Params(new Parameter("selectHolidayDocument", "App.gpQueryHolidayDocuments.getRowsValues({ selectedOnly: true })[0].ID", ParameterMode.Raw))
                .Params(new Parameter("processState", "1"))
                )
    )
}
